package com.xizimall.rest.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xizimall.rest.service.RedisService;
import com.xizimall.common.pojo.XizimallResult;

/**
 * 缓存同步Controller
 * <p>Title: RedisController</p>
 * <p>Description: </p>
 * <p>华南理工大学研究生</p> 
 * @author	李隆熹
 * @date	2018年4月23日下午9:52:49
 * @version 1.0
 */
@Controller
@RequestMapping("/cache/sync")
public class RedisController {
   @Autowired
   private RedisService redisService;
   
   @RequestMapping("/content/{contentCid}")
   @ResponseBody
   public XizimallResult contentCacheSync(@PathVariable Long contentCid){
	   XizimallResult result=redisService.syncContent(contentCid);
	   return result;
   }
   @RequestMapping("/itemCat/{parentId}")
   @ResponseBody
   public XizimallResult itemCatCacheSync(@PathVariable Long parentId){
	   XizimallResult result =redisService.syncItemCat(parentId);
	   return result;
   }
}
